$(function(){
    var oLi = $(".typebox li")
    var aCon = $(".type_box_list li")
    var img = $(".bannerimg img")
	var timer = null;
	for (var i = 0; i < oLi.length; i++) {
	   oLi[i].index = i;
	   oLi[i].onclick = function() {
	      show(this.index);
	   }
	}
	
	//切换不同类型交易记录
	function show(a) {
		index = a;
		var alpha = 0;
		for (var j = 0; j < oLi.length; j++) {
		    oLi[j].className = "";
		    aCon[j].className = "";
		    img[j].className = "";
		    aCon[j].style.opacity = 0;
		    aCon[j].style.filter = "alpha(opacity=0)";
		}
		oLi[index].className = "cur";
		aCon[index].className = "cuA";
		img[index].className = "cuA";
		clearInterval(timer);
	    timer = setInterval(function() {
	    	alpha++
	        alpha > 100 && (alpha = 100);
	        aCon[index].style.opacity = alpha / 100;
	        aCon[index].style.filter = "alpha(opacity=" + alpha + ")";
	        alpha == 100 && clearInterval(timer);
	    },5)
	}

	//切换不同的链接
	 $(".xka").click(function(){
        var ss = $(".xka").val();
        $(".butbox a").removeClass("cuB")
        if (ss == "data0") {
            $(".butbox a").eq(0).addClass("cuB")
        }
        if (ss == "data1") {
            $(".butbox a").eq(1).addClass("cuB")
        }
        if (ss == "data2") {
            $(".butbox a").eq(2).addClass("cuB")
        };
    });
	// 右边banner
	$(window).scroll(function(){ 
	    if ($(window).scrollTop()>35){ 
	      $(".flgw .rightBox").css("margin-top","25px");
	    }else{ 
	      $(".flgw .rightBox").css("margin-top","60px");
	    } 
	});

});